<template>
  <div class="home">

    <div class="header-box clearfix">
      <a style="padding-top: 6px;">
        <img src="@/assets/img/cssc/first-page/csscaito.png" alt="">
      </a>
      <div class="user">
        <p class="text">用户：{{ info.nick_name }}</p>
        <p class="text" style="">
          <router-link v-show="this.$isFirstPage" to="/my/info">个人中心</router-link>
          <router-link v-show="!this.$isFirstPage" to="/">返回首页</router-link>
        </p>
      </div>
    </div>
    <div type="main">

      <div class="left_div">
        <div class="frame_div frame_divto">
          <p class="title_font">数据集</p>
          <el-image :src="require('@/assets/img/cssc/first-page/frame_icon.png')"></el-image>
          <el-table :data="tableData0" :style="{ overflow: overf, height: gao + 'px' }"
            :header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'left' }">
            <el-table-column prop="file_type" label="类型" min-width="20%">
              <template slot-scope="{ row }">
                <div v-if="row.file_type == 0"><span>图片</span></div>
                <div v-if="row.file_type == 1"><span>文本</span></div>
                <div v-if="row.file_type == 2"><span>视频</span></div>
                <div v-if="row.file_type == 3"><span>表格</span></div>
                <div v-if="row.file_type == 4"><span>其他</span></div>
              </template>
            </el-table-column>
            <el-table-column prop="name" label="名称" min-width="40%" :show-overflow-tooltip='true'></el-table-column>
            <el-table-column prop="name" label="数量" min-width="20%">
              <template>
                <div style="text-align: center;">1</div>
              </template>
            </el-table-column>
          </el-table>
        </div>

        <div class="frame_div frame_divto">
          <p class="title_font">训练模型</p>
          <el-image :src="require('@/assets/img/cssc/first-page/frame_icon.png')"></el-image>
          <el-table :data="tableData2" :style="{ overflow: overf, height: gao + 'px' }"
            :header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'left' }">
            <el-table-column prop="type" label="类型" min-width="20%">
              <template slot-scope="{ row }">
                <div v-if="row.type == 1">深度学习</div>
                <div v-if="row.type == 2">强化学习</div>
              </template>
            </el-table-column>
            <el-table-column prop="name" min-width="40%" label="名称"></el-table-column>
            <el-table-column prop="name" label="数量" min-width="20%">
              <template>
                <div style="text-align: center;">1</div>
              </template>
            </el-table-column>
          </el-table>
        </div>
      </div>
      <div class="center_div" :style="{ width: dwidth }">
        <div class="center_top_div" :style="{marginTop: centerTopMarginTop, marginBottom: centerTopMarginBottom,height: centerTopHeight}">
          <div>
            <div class="tpto1" @click="openAlpha()">
              <img style="display: block;margin-left: 15px;width: 150px;height: 150px;"
                src="@/assets/img/cssc/first-page/tsgz.png" />
              <img style="margin-left: 15px; width: 150px;height: 41px;" src="@/assets/img/cssc/first-page/tsgzto.png" />
            </div>
            <div class="tpto2" @click="openBetato()">
              <img style="display: block;margin-left: 70px;width: 150px;height: 150px;"
                src="@/assets/img/cssc/first-page/zhjc.png" />
              <img style="margin-left: 70px;width: 150px;height: 41px;" src="@/assets/img/cssc/first-page/rwgh.png" />
            </div>
            <div class="tpto3" @click="openBeta()">
              <img style="display: block;margin-left: 15px;width: 150px;height: 150px;"
                src="@/assets/img/cssc/first-page/xdkz.png" />
              <img style="margin-left: 15px;width: 150px;height: 41px;" src="@/assets/img/cssc/first-page/xdkzto.png" />
            </div>
          </div>
          <div style="pointer-events: none;">
            <img style="width: 100%;margin-top: -110px;" src="@/assets/img/cssc/first-page/bottom_icon.png" />
          </div>
        </div>
        <div class="center_bottom_div">
          <ul class="home-monitoring">
            <li class="cpu">
              <p class="name">CPU</p>
              <percentage :res="cpuRes"/>
              <div class="monitoring-layer" @mouseover="monitoringOver('cpuRes')" @mouseout="monitoringOut('cpuRes')">
              </div>
            </li>
            <li class="ram">
              <p class="name">内存</p>
              <percentage :res="memRes"/>
              <div class="monitoring-layer" @mouseover="monitoringOver('memRes')" @mouseout="monitoringOut('memRes')">
              </div>
            </li>
            <li class="gpu">
              <p class="name">GPU</p>
              <percentage :res="gpuRes"/>
              <div class="monitoring-layer" @mouseover="monitoringOver('gpuRes')" @mouseout="monitoringOut('gpuRes')">
              </div>
            </li>
          </ul>
          <el-radio-group v-model="showThisActive" size="medium"  @change="checkActicve(showThisActive)" class="nav-alike nav-job">
            <el-radio-button :label="0">
              <span class="nav-alike-item">模型开发</span>
            </el-radio-button>
            <el-radio-button :label="1">
              <span class="nav-alike-item">模型训练</span>
            </el-radio-button>
            <el-radio-button :label="2">
              <span class="nav-alike-item" v-if="!$isReinforce">模型部署</span>
              <span class="nav-alike-item" v-if="$isReinforce">模型测试</span>
            </el-radio-button>
          </el-radio-group>
          <div class="table-data">
            <el-table :data="tableDataindex" :style="{ overflow: overf, height: gaoto + 'px' }">
              <el-table-column prop="name" label="名称">
                <template slot-scope="{ row }">
                  <el-popover placement="right-start" width="320" trigger="hover">
                    <row-data :row="row" />
                    <span slot="reference">{{ row.name }}</span>
                  </el-popover>
                </template>
              </el-table-column>              
              <el-table-column prop="id" label="任务类型" width="120">
                <template slot-scope="{ row }">
                  <span>{{ row.simulation_port_list == null ? '深度学习' : '强化学习' }}</span>
                </template>
              </el-table-column>
              <el-table-column prop="resource.start_time" label="启动时间" width="180"/>
              <el-table-column prop="update_time" label="运行时长" width="120">
                <template slot-scope="{ row }">
                  {{ countRanTime(row.resource.start_time) }}
                </template>
              </el-table-column>
              <el-table-column prop="status" label="状态" width="120">
                <template slot-scope="{ row }">
                  <span :class="['alick-list-status', row.status]">●{{ statusMap[row.status] }}</span>
                </template>
              </el-table-column>
              <el-table-column prop="update_time" label="操作" width="120">
                <template slot-scope="{ row }">
                  <!-- <el-button type="text" @click="monitoring(row)" :disabled="row.status != 'running'">监控</el-button> -->
                  <el-button type="text" @click="toDetail(row)">进入</el-button>
                </template>
              </el-table-column>
            </el-table>
          </div>
          <div class="pagination-box" v-if="Pagedataindex.total > Pagedataindex.size">
            <el-pagination background class="pagination" layout="total, prev, pager, next, jumper"
              :page-size="Pagedataindex.size" :current-page.sync="Pagedataindex.current"
              @current-change="handleCurrentChange" :total="Pagedataindex.total">
            </el-pagination>
          </div>
          <drawer-log ref="drawerLog" :row="rowData" />

        </div>
      </div>
      <div class="right_div">
        <div class="frame_div frame_divto">
          <p class="title_font">强化学习算法</p>
          <el-image :src="require('@/assets/img/cssc/first-page/frame_icon.png')"></el-image>
          <el-table :data="tableData3" :style="{ overflow: overf, height: gao + 'px' }"
            :header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'left' }">
            <el-table-column prop="desc" label="类型" min-width="20%"></el-table-column>
            <el-table-column prop="name" label="名称" min-width="40%" :show-overflow-tooltip='true'></el-table-column>
            <el-table-column prop="name" label="数量" min-width="20%">
              <template >                
                <div style="text-align: center;">1</div>
              </template>
            </el-table-column>
          </el-table>
        </div>

        <div class="frame_div frame_divto">
          <p class="title_font">深度学习算法</p>
          <el-image :src="require('@/assets/img/cssc/first-page/frame_icon.png')"></el-image>
          <el-table :data="tableData1" :style="{ overflow: overf, height: gao + 'px' }"
            :header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'left' }">
            <el-table-column prop="desc" label="类型" min-width="20%"></el-table-column>
            <el-table-column prop="name" label="名称" min-width="40%" :show-overflow-tooltip='true'></el-table-column>            
            <el-table-column prop="name" label="数量" min-width="20%">
              <template>
                <div style="text-align: center;">1</div>
              </template>
            </el-table-column>
          </el-table>
        </div>
      </div>
    </div>

  </div>
</template>
<script>
import { formatTime } from '@/utils/tool'
import { getMarketDataSets } from '@/api/marketDataset'
import { getMarketAlgorithms } from '@/api/marketAlgorithm'
import Vue from 'vue'
import { getGameExperimentMonitor, stopGameExperiment, getGameExperiment } from '@/api/gameExperiment'
import { getGameTaskVersionsMonitor, stopGameTaskVersion } from '@/api/gameTask'
import { getGameSimulationMonitor, stopGameSimulation } from '@/api/gameSimulation'
import { getExperiment, getExperimentMonitor, stopExperiment } from '@/api/notebook'
import { getTaskVersionsMonitor, stopTaskVersion } from '@/api/task'
import { getDeploysMonitor, stopServing } from '@/api/deploy'
import { getAllResource } from '@/api/dashboard'
import { getCookie } from '@/utils/tool'
import percentage from './module/percentage'
import drawerLog from './module/drawer-log'
import { removeCookie, setCookie } from '@/utils/tool'
import { userOrgs } from '@/api/user'
import { displaceToken } from '@/api/login'
export default {
  name: "index-cssc",
  data() {
    return {
      overf: 'auto',
      gao: 330,
      gaoto: 150,
      dwidth: "57%",
      centerTopHeight: "405px",
      centerTopMarginTop: "1px",
      centerTopMarginBottom: "1px",
      org: '',
      info: {},
      args: [],
      options: [],
      value: '',
      oldValue: '',
      tableData: [{
        status: 0,
        type: '文字识别',
        count: 998
      }, {
        status: 1,
        type: '语音识别',
        count: 888
      }, {
        status: 0,
        type: '目标识别',
        count: 777
      }, {
        status: 1,
        type: '图像描述',
        count: 666
      }, {
        status: 0,
        type: '生物医学',
        count: 660
      }],
      Pagedata: {
        pageNum: 1,
        pageSize: 20,
        total: 0,
        resourceType: 0,// 数据集
        name: "", // 名称搜索
        order: "recommend", // 排序recommend、createTime、likeCount
      },
      tableData0: [],
      tableData1: [],
      tableData2: [],
      tableData3: [],
      type: process.env.VUE_APP_VERSIONS == 'alpha' ? 1 : 2,
      clock: '',
      clockTime: null,
      host: window.location.host,
      hostIp: null,
      showThisActive: 0,
      tableDataindex: [],
      rowData: [],
      cpuRes: {},
      memRes: {},
      gpuRes: {},
      screeWidth: document.body.clientWidth,
      screeHeight: document.body.clientHeight,
      Pagedataindex: {
        current: 1,
        size: 10,
        total: 0,
      },
    }
  },

  mounted() {
    window.addEventListener('resize', () => {
      this.screeHeight = document.body.clientHeight;
      console.log("bbbbbb", this.screeWidth)
      console.log('aaaaaaa--------' + this.screeHeight);
    })

    this.getMarketDataSets()
    this.getImages()
    this.getMarketAlgorithms()
    this.getExperiment()
    this.clockTime = setInterval(() => {
      this.clock = formatTime(new Date(), 'YYYY-MM-DD HH:mm:ss')
    }, 1000)
    this.hostIp = this.host.split(":")[0]

    
    if (!this.$isFirstPage) {
      Vue.prototype.$isFirstPage = true;
    }
    
    this.getData()
    this.$EventBus.$on('experiment', () => {
      if (this.showThisActive == 0) this.getData()
    })
    this.$EventBus.$on('train', () => {
      if (this.showThisActive == 1 || this.showThisActive == 2) this.getData()
    })
    this.$EventBus.$on('serving', () => {
      if (this.showThisActive == 2) this.getData()
    })
  },
  watch: {
    screeHeight: {
      immediate: true,
      handler: function (val) {
        if (val > 1439) {
          this.gao = 580;          
          this.gaoto = this.gao - 160
          this.dwidth = "58%"
          this.centerTopHeight = "405px"          
          this.centerTopMarginTop = "110px"              
          this.centerTopMarginBottom = "120px"
          console.log('屏幕高度1:' + val);
          console.log('屏幕高度11:' + this.gaoto);
        } else if (val > 1320) {
          this.gao = 520;          
          this.gaoto = this.gao - 160
          this.dwidth = "58%"          
          this.centerTopHeight = "405px"
          this.centerTopMarginTop = "50px"          
          this.centerTopMarginBottom = "120px"
          console.log('屏幕高度1:' + val);
          console.log('屏幕高度11:' + this.gaoto);
        } else if (val > 961) {
          this.gao = 400;              
          this.gaoto = this.gao - 160     
          this.centerTopMarginTop = "50px"
          console.log('屏幕高度1:' + val);
          console.log('屏幕高度11:' + this.gaoto);
        } else {
          this.gao = 330;
          this.gaoto = this.gao - 145
          console.log('屏幕高度2:' + val);
          console.log('屏幕高度22:' + this.gaoto);
        }
      }
    }
  },
  destroyed() {
    clearInterval(this.clockTime)
    this.$EventBus.$off('experiment')
    this.$EventBus.$off('train')
    this.$EventBus.$off('serving')
  },
  components: {
    percentage,
    drawerLog
  },
  methods: {

    async logout() {
      removeCookie('login_ticket')
      removeCookie('refresh_token')
      this.$router.push({
        path: '/login'
      })
    },
    async changeOrg(id) {
      var obj = new Object()
      obj.organizationId = id;
      this.$messageBox.confirm('此操作将会刷新页面, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(async () => {
        var res = await displaceToken({ "organizationId": obj.organizationId });
        if (res.code == 200) {
          setCookie('login_ticket', `Bearer ${res.data.access_token}`)
          setCookie('refresh_token', res.data.refresh_token)
          this.oldValue = obj.organizationId;
          window.location.reload();
        }
        this.$message({
          type: 'success',
          message: '操作成功!'
        });
      }).catch(async () => {
        this.value = this.oldValue;
        this.$message({
          type: 'info',
          message: '已撤销'
        });
      });
    },



    applyResource() {

    },
    async getCakeData() {
      let resCpu = await getAllResource({ resourceType: "cpu" });
      let resMem = await getAllResource({ resourceType: "mem" });
      let resGpu = await getAllResource({ resourceType: "gpu" });
      this.cpuRes = resCpu.data
      resCpu.data.color = "#7872F6"
      resCpu.data.underpainting = "rgba(120, 114, 246, .2)"
      this.memRes = resMem.data
      resMem.data.color = "#4BACE4"
      resMem.data.underpainting = "rgba(75, 172, 228, .2)"
      this.gpuRes = resGpu.data
      resGpu.data.color = "#2E79F6"
      resGpu.data.underpainting = "rgba(46, 121, 246, .2)"
    },
    async getExperimentto() {
      let res = null
      let res2 = null
      res = await getGameExperimentMonitor({ ...this.Pagedataindex })
      res2 = await getExperimentMonitor({ ...this.Pagedataindex })
      for (let rec1 of res.data.list) {
        rec1.detailUrl = this.genDetailUrl(`${this.hostIp}:8082`, "gameExperiment", rec1.id)
      }
      for (let rec2 of res2.data.list) {
        rec2.detailUrl = this.genDetailUrl(this.host, "notebook", rec2.id)
      }
      this.tableDataindex = res.data.list
      this.tableDataindex = this.tableDataindex.concat(res2.data.list)
      this.Pagedataindex.total = res.data.total
    },
    async getTaskVersions() {
      let res = null
      let res2 = null
      res = await getGameTaskVersionsMonitor({ type: 1, ...this.Pagedataindex })      
      res2 = await getTaskVersionsMonitor({ type: 1, ...this.Pagedataindex })      
      for (let rec1 of res.data.list) {
        rec1.detailUrl = this.genDetailUrl(`${this.hostIp}:8082`, "gameTask", rec1.game_task_id) + "&source_version_id=" + rec1.id
      }
      for (let rec2 of res2.data.list) {
        rec2.detailUrl = this.genDetailUrl(this.host, "task", rec2.task_id) + "&source_version_id=" + rec2.id
      }
      this.tableDataindex = res.data.list
      this.tableDataindex = this.tableDataindex.concat(res2.data.list)
      console.log("this.tableDataindex", this.tableDataindex)
      this.Pagedataindex.total = res.data.total
    },
    async getDeploys() {
      let res = null;
      let res2 = null
      res = await getGameTaskVersionsMonitor({ type: 2, ...this.Pagedataindex })
      res2 = await getDeploysMonitor({ type: 1, ...this.Pagedataindex })      
      for (let rec1 of res.data.list) {
        rec1.detailUrl = this.genDetailUrl(`${this.hostIp}:8082`, "gameModelTest", rec1.id)
      }
      for (let rec2 of res2.data.list) {
        rec2.detailUrl = this.genDetailUrl(this.host, "deploy", rec2.id)
      }
      this.tableDataindex = res.data.list
      this.tableDataindex = this.tableDataindex.concat(res2.data.list)
      this.Pagedataindex.total = res.data.total
    },
    async getSimulationTask() {
      let res = await getGameSimulationMonitor({ type: 1, ...this.Pagedataindex })
      this.tableDataindex = res.data.list
      for (let i = 0; i < this.tableDataindex.length; i++) {
        this.tableDataindex[i].name = this.tableDataindex[i].deploy_name
      }
      this.Pagedataindex.total = res.data.total
    },
    getData() {
      this.tableDataindex = []
      this.Pagedataindex = {}
      if (this.showThisActive == 0) {
        this.getExperimentto()
      }
      if (this.showThisActive == 1) {
        this.getTaskVersions()
      }
      if (this.showThisActive == 2) {
        this.getDeploys()
      }
      if (this.showThisActive == 3) {
        this.getSimulationTask()
      }
      this.getCakeData()
    },


    monitoringOver(type) {
      let thisType = { ...this[type] }
      thisType.tempColor = thisType.color
      thisType.tempUnderpainting = thisType.underpainting
      thisType.color = '#FFF'
      thisType.underpainting = 'rgba(255, 255, 255, .2)'
      this[type] = {}
      setTimeout(() => {
        this[type] = thisType
      })
    },
    monitoringOut(type) {
      let thisType = { ...this[type] }
      thisType.color = thisType.tempColor
      thisType.underpainting = thisType.tempUnderpainting
      this[type] = {}
      setTimeout(() => {
        this[type] = thisType
      })
    },
    monitoring(row) {
      this.rowData = row
      this.rowData.active = this.showThisActive
      this.$refs.drawerLog.shwoDrawer = true
    },
    async stop({ id }) {
      if (this.showThisActive == 0) {
        if (this.$isReinforce) {
          await stopGameExperiment({ id })
        } else {
          await stopExperiment({ id })
        }
      }
      if (this.showThisActive == 1) {
        if (this.$isReinforce) {
          await stopGameTaskVersion({ id })
        } else {
          await stopTaskVersion({ id })
        }
      }
      if (this.showThisActive == 2) {
        if (this.$isReinforce) {
          await stopGameTaskVersion({ id })
        } else {
          await stopServing(id)
        }
      }
      if (this.showThisActive == 3) {
        await stopGameSimulation(id)
      }
      this.getData()
    },

    genDetailUrl(host, taskType, taskId) {
      return `http://${host}/#/${taskType}/code?id=${taskId}`
    },

    toDetail(row) {
      console.log("row.detailUrl", row.detailUrl)
      window.open(row.detailUrl, "_self");
    },

    checkActicve(i) {
      this.showThisActive = i
      this.Pagedataindex.current = 1
      this.getData()
    },
    handleCurrentChange(val) {
      this.Pagedataindex.current = val
      this.getData()
    },




    async getMarketDataSets() {
      let res = await getMarketDataSets({ ...this.Pagedata, visibility: '2' })
      if (res && res.data) {
        let ret = res.data
        this.tableData0 = ret.list
      }
    },
    async getImages() {
      let res = await getGameExperiment({ visibility: this.showThisActive, ...this.Pagedata })
      if (res && res.data) {
        let ret = res.data
        this.tableData3 = ret.list
        //this.Pagedata.total = ret.total
      }
    },
    async getMarketAlgorithms() {
      let res = await getMarketAlgorithms({ ...this.Pagedata })
      if (res && res.data) {
        let ret = res.data
        this.tableData2 = ret.list
        //this.Pagedata.total = ret.total
      }
    },
    async getExperiment() {
      let res = await getExperiment({ ...this.Pagedata })
      if (res && res.data) {
        let ret = res.data
        this.tableData1 = ret.list
      }
    },
    openAlpha() {
      var url = `http://${this.host}/#/notebook`
      window.open(url, "_self");
    },
    openBeta() {
      var url = `http://${this.hostIp}:8082/#/gameExperiment`
      window.open(url, "_self");
    },
    openBetato() {
      var url = `http://${this.hostIp}:8082/#/gameExperiment`
      window.open(url, "_self");
    },

  },
  async beforeCreate() {
    if (this.$indexReload == 1) {
      Vue.prototype.$indexReload = 0;
      window.location.reload();
    }
    this.info = await this.$myInfo(this)
    if (this.info != null) {
      var obj = new Object()
      obj.userId = this.info.id;
      this.orgs = await userOrgs(obj)
      if (this.orgs != null && this.orgs.data.length > 0) {
        for (var i = 0; i < this.orgs.data.length; i++) {
          var option = new Object();
          option.value = this.orgs.data[i].organization.id;
          option.label = this.orgs.data[i].organization.name;
          this.options.push(option)
        }
        this.value = this.info.organization_id;
      }
    }
    //
    this.oldValue = this.value;
    if (decodeURIComponent(getCookie('login_ticket')) == '') {
      this.$router.push({
        path: '/login'
      })
    }
    return
  },

}
</script>
<style lang="less" scoped>
.logo {
  padding: 0 24px;
  overflow: hidden;
  width: 100%;

  a {
    padding-top: 10px;
    float: left;

    img {

      display: block;
      height: 36px;
    }
  }

  span {
    color: #064c8d;
    // float: right;
    font-weight: bold;
    padding-top: 40px;
    // margin-top: 40px;
    font-size: 24px;
    line-height: 24px;
    float: right;
  }
}

.logo-foot {

  // padding-bottom: 10px;
  position: absolute; // 关键
  bottom: 0;
  left: 0px;
  width: 94%;
  right: 0;

  a {
    img {
      padding-top: 30px;
      padding-left: 5px;
      display: block;
      height: 28px;
      padding-bottom: 10px;
    }
  }
}

html,
body,
#app,
.el-container {
  padding: 0%;
  margin: 0%;
  min-height: 100%;
}

.home {
  height: 100%;
  background: #eee;
  padding: 0 24px;
  position: absolute;
}

.left_div {
  width: 20%;
  height: 100%;
  // height: 706px;
  float: left;
  margin-right: 20px;
}

.center_div {
  width: 56%;
  // height: 100%;
  float: left;
}

.right_div {
  width: 20%;
  height: 100%;
  float: left;
  margin-left: 20px;
}

.frame_div {
  min-height: 400px;
  height: 70%;
  margin-bottom: 10px;
  padding: 15px 15px 10px 15px;
  background: #FFFFFF;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);

  .el-image {
    line-height: 10px;
  }
}

.frame_divto {
  // padding-bottom: 37%;
}

.center_top_div {
  padding: 15px;
  position: relative
}

.center_bottom_div {
  // height: 260;
  margin-bottom: 20px;
  padding: 15px 15px 5px 15px;
  background: #FFFFFF;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);

  .table-data {
    min-height: 130px;
  }
}

.title_font {
  font-size: 18px;
  font-family: HarmonyOS Sans SC-Regular, HarmonyOS Sans SC;
  /*font-weight: 400;*/
  color: #000000;
  line-height: 28px;
}

el-table {
  width: 100%;
  font-size: 14px;
}

el-table>el-table-column {
  text-align: center;
}

.runningto {
  width: 10px;
  height: 10px;
  background: #00B82A;
  opacity: 1;
  border-radius: 10px;
}

.stoped {
  width: 10px;
  height: 10px;
  background: #CF3A2B;
  opacity: 1;
  border-radius: 10px;
}

.other {
  width: 10px;
  height: 10px;
  background: #FEB96A;
  opacity: 1;
  border-radius: 10px;
}


.table-data {
  padding: 0 16px;
  background: #FFF;
  border-radius: 0 10px 10px 10px;
}


.home-monitoring {
  display: flex;
  width: 100%;

  li {
    flex: 1;
    margin: 0 8px;
    height: 166px;
    background: #FFF;
    border-radius: 10px;
    cursor: pointer;
    transition: all .3s;
    position: relative;

    .monitoring-layer {
      position: absolute;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      z-index: 2;
    }

    .name {
      // margin-top: 22px;
      text-align: center;
      padding-top: 38px;
      line-height: 32px;
      position: relative;

      &::before {
        display: block;
        width: 38px;
        height: 38px;
        content: ' ';
        position: absolute;
        left: 50%;
        top: 0%;
        margin: 0 0 0 -19px;
        mask-size: 38px 38px;
      }
    }

    &:hover {
      .name {
        color: #FFF;

        &::before {
          background: #FFF;
        }
      }
    }
  }
}


.cpu {
  .name::before {
    mask-image: url(~@/assets/img/icon-home-gpu.svg);
    background: #7872F6;
  }

  &:hover {
    background: #7872F6;
  }
}

.vgpu {
  .name::before {
    mask-image: url(~@/assets/img/icon-home-gpu.svg);
    background: #F6CC0D;
  }

  &:hover {
    background: #F6CC0D;
  }
}

.ram {
  .name::before {
    mask-image: url(~@/assets/img/icon-home-ram.svg);
    background: #4BACE4;
  }

  &:hover {
    background: #4BACE4;
  }
}

.gpu {
  .name::before {
    mask-image: url(~@/assets/img/icon-home-gpu.svg);
    background: #2E79F6;
  }

  &:hover {
    background: #2E79F6;
  }
}

.header-box {
  padding: 6px 0 0 6px;
  width: 100%;
  box-sizing: border-box;

  a {
    // padding-top: 6px;
    float: left;

    img {

      display: block;
      height: 46px;
    }
  }

  .handle {
    float: left;
    padding-top: 10px;

    .search {
      float: left;
      width: 22px;
      height: 22px;
      margin-right: 16px;
      background: url(~@/assets/img/search.png) no-repeat;
      background-size: 22px 22px;
    }

    .full {
      float: left;
      width: 22px;
      height: 22px;
      margin-right: 16px;
      background: url(~@/assets/img/full.png) no-repeat;
      background-size: 22px 22px;
    }
  }

  .user {
    float: right;

    .text {
      float: left;
      margin-right: 16px;
      padding-top: 10px;
      color: #8F9299;

      a {
        color: #8F9299;

        &:hover {
          color: #409EFF;
        }
      }
    }

    .user-box {
      float: left;
      cursor: pointer;

      img {
        width: 40px;
        height: 40px;
      }
    }
  }
}

.user-box-item {
  text-align: center;

  a {
    color: #409EFF;
  }
}

.tpto1 {
  float: left;
  margin-left: 16%;
}

.tpto2 {
  // float: left;
  // margin-left: 4%;
  // display: flex;
  // justify-content: center;
  // margin: 0 auto;
  position: absolute;
  left: 48%;
  transform: translateX(-50%);
}

.tpto3 {
  float: right;
  margin-right: 16%;
}

// .eltable1{
//   min-width: 20%;

// }
// .eltable2{
//   min-width: 50%;
// }
// .eltable3{
//   min-width: 30%;
// }
.alick-list-status {
  padding: 0;
}

.nav-job {
  margin-top: 60px;
}
</style>
